<@master template="master/master-loan"  title="品牌查询">
<div class="detaiTab  detaiTab1 detailsBox">
    <div class="openBox">
        <div id="record_log" class="action-ajax-load "
             data-url="/brand/to_model?parameter=${parameter}&isEdit=${isEdit}"></div>
        <div class="action-ajax-load detailsBox" data-url="<@url value='${agreeUrl}' />">审核历史加载中。。。</div>
    </div>
    <#if brandEntityById.wfStatus == 0>
        <div class="openBox">
            <h3>
                <i class="jtIco"></i>经销商合作方
            <#--<@permission permissionName="addPartner">
                <a href="/jxsPartner/choosePartner?brandId=${parameter}" class="fr edit btn_blue" target="_blank">添加经销商合作方</a>
            </@permission>-->
            </h3>
            <div id="partner_detail" class="action-ajax-load "
                 data-url="/jxsPartner/rest/list?brandId=${parameter}"></div>
        </div>
        <div class="openBox">
            <h3>
                <i class="jtIco"></i>厂家合作方
            <#--<@permission permissionName="addPartner">
                <a class="action-ajax-btn fr edit btn_blue" data-url="<@url value='/rpartner/view_add?brandId=${parameter}'/>">添加厂家合作方</a>
            </@permission>-->
            </h3>
            <div id="partner_detail" class="action-ajax-load " data-url="/rpartner/detail?brandId=${parameter}"></div>
        </div>
        <div class="openBox">
            <h3>
                <i class="jtIco"></i>修改信息记录
            </h3>
            <div class="detaiTab">
                <div id="record_log" class="action-ajax-load "
                     data-url="/rpartner/recordlog?logType=${parameter}"></div>
            </div>
        </div>
    </#if>
</div>
<script>
    function getParam(url, name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = url.substr(url.indexOf("?") + 1).match(reg);
        if (r != null)return unescape(r[2]);
        return null;
    }

    function getQueryStr(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)return unescape(r[2]);
        return null;
    }

    window.onload = function () {
        var p = getQueryStr('p');
        if(null == p || "" == p){
            return;
        }
        setTimeout(function() {
            $("table .action-ajax-btn ").each(function () {
                var url = $(this).data('url');

                var p1 = getParam(url, 'parameter');
                var p2 = getParam(url, 'partnerId');

                if(p == p1 ||  p == p2 ){
                    $(this).click();
                }
            });
        }, 2500);
    };
</script>
</@master>